from flask_cors import CORS

from apis.admin.adv import adv_bp
from apis.admin.menu import menu_bp
from apis.client.news import news_bp
from apis.client.photo import photo_bp
from apis.home import home_bp
from application import app
# 解决跨域问题
CORS(app, supports_credentials=True)

# 客户端
app.register_blueprint(home_bp, url_prefix='/api/v1')
app.register_blueprint(news_bp, url_prefix='/api/v1/news')
app.register_blueprint(photo_bp, url_prefix='/api/v1/photos')

# 后台管理系统
app.register_blueprint(menu_bp, url_prefix='/api/v1/admin/menu')
app.register_blueprint(adv_bp, url_prefix='/api/v1/admin/adv')
